window.viewSubCompany = id => {
    if(window.em){
        // console.debug(1);
    }else{
        // console.debug(2);
    }
}

window.viewDepartment = id => {
    if(window.em){
        // console.debug(1);
    }else{
        // console.debug(2);
    }
}

const configNavigation = (data) => {
    const em = window.em;
    if (em && em.checkJsApi("configNavigation")) {
        const config = (typeof data == "string") ? { title: data } : data;
        em.configNavigation(config)
    }
}

const formatUrl = params => {
    params = Object.values(params).reduce((a,b,i) => `${a}${Object.keys(params)[i]}=${b}&`, '?');
    return params.substring(0, params.length - 1);
}

export {
    configNavigation,
    formatUrl
}